import { DEFAULT_LAYOUT } from '../base'
import { AppRouteRecordRaw } from '../types'
import permissionType from "@/utils/permissionType";

const DASHBOARD: AppRouteRecordRaw = {
  path: '/dashboard',
  name: 'dashboard',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: '成本预估',
    requiresAuth: true,
    icon: 'icon-home',
    order: 0,
  },
  children: [
    {
      path: 'workplace',
      name: 'Workplace',
      component: () => import('@/views/dashboard/workplace/index.vue'),
      meta: {
        locale: '首页',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'caizhi',
      name: 'CaiZhi',
      component: () => import('@/views/caizhi/index.vue'),
      meta: {
        locale: '材质管理',
        requiresAuth: true,
        roles: [permissionType.caizhiAdmin, permissionType.sysAdmin],
      },
    },
    {
      path: 'gongyi',
      name: 'GongYi',
      component: () => import('@/views/gongyi/tab.vue'),
      meta: {
        locale: '工艺管理',
        requiresAuth: true,
        roles: [permissionType.gongyiAdmin, permissionType.sysAdmin],
      },
    },
    {
      path: 'czgy',
      name: 'CaiZhiGongYi',
      component: () => import('@/views/caizhi/caizhi_gongyi.vue'),
      meta: {
        locale: '材质工艺关联',
        requiresAuth: true,
        roles: [permissionType.caizhiGongYi, permissionType.sysAdmin],
      },
    },
    {
      path: 'duanzao',
      name: 'DuanZao',
      component: () => import('@/views/duanzao/index.vue'),
      meta: {
        locale: '钢类基础锻造费',
        requiresAuth: true,
        roles: [permissionType.duanzao, permissionType.sysAdmin],
      },
    },
    {
      path: 'xishu',
      name: 'XiShu',
      component: () => import('@/views/basedata/myconfig.vue'),
      meta: {
        locale: '加工费系数',
        requiresAuth: true,
        roles: [permissionType.xishu, permissionType.sysAdmin],
      },
    },
  ],
}

export default DASHBOARD
